<!--更新社团信息
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title>修改界面</title>
    <style>
        body{height: 100%;
            width: 100%;
            background-image:url('../static/images/update.jpg');
            background-size: cover;
            position: absolute;
            overflow: hidden;
        }
        .top_title{
            margin-top:100px;
            text-align:center;
        }
        #login{
            background-color:rgba(255,255,255,.7);
            width:500px;
            margin:20px auto;
            border-radius:6px;
        }
        .login_title{
            height:30px;
            text-align:center;
            margin-bottom:10px;
        }
        table{
            width:310px;
            margin:0 auto;
        }
        .input{
            height:30px;
            width:220px;
        }
        .login_tr{
            margin:10px 0;
        }
        .login_tr td{
            width:100px;
            white-space:nowrap;
        }
        .login_btn_submit,.login_btn_reset{
            width:144px;
            height:35px;
            background-color:lightblue;
            border:1px solid lightblue;
            border-radius:6px;
            transition:1s;
        }
        .login_btn_reset{
            background-color:#a0d86d;
            border:1px solid #a0d86d;
        }
        .login_btn_submit:hover{
            background-color:#4aadce;
        }
        .login_btn_reset:hover{
            background-color:#6cbd21;
        }
        .login_btn{
            width:295px;
            margin:10px auto;
            padding-bottom:20px;
        }
        .login_btn_login{
            width: 300px;
            height: 35px;
            margin: 10px 0;
            background-color:#ded86a;
            border:1px solid #ded86a;
            border-radius:6px;
            transition: 1s;
        }
        .login_btn_login:hover{
            background-color:#a59d1b;
        }
        .login_btn form{
            margin: 0;
        }
        #info1 {
            height: 30px;
            text-align: center;
        }
    </style>


</head>

<body>
<h2 class='top_title'>社团管理</h2>
<div id='login'>
    <div class='login_title'>
        <h3>修改界面</h3>
    </div>
    <form action="mainTest.html" method="post">
    <table>
        <tbody>
        <c:forEach var="mess" items="${mess}">
            <tr class='login_tr'>
                <td>社团id：</td>
                <td><input type='text' class='input' value='${mess.a_id}' name='a_id' id="a_id" /></td>
            </tr>
            <tr class='login_tr'>
                <td>社团名字：</td>
            <td>
                <input type='text' class='input' value='${mess.a_name}' name='a_name' id="a_name" />

            </td>
            </tr>
            <tr class='login_tr'>
                <td>社团会长：</td>
                <td><input type='text' class='input' value='${mess.a_username}' name='username' /></td>
            </tr>
            <tr class='login_tr'>
                <td>社团创建时间：</td>
                <td><input type='text' class='input' value='${mess.creationtime}' name='creationtime' /></td>
            </tr>
            <tr class='login_tr'>
                <td>社团图片：</td>
                <td><input type='file' class='input' name='a_url' id="a_url" accept="image/jpeg, image/jpg, image/png"/></td>
            </tr>

        </c:forEach>
        </tbody>
    </table>
        <p id="info1"></p>
    <div class='login_btn'>
        <input type="submit" value="保 存 修 改" class="login_btn_login" id="submit"/>
    </div>

    </form>
</div>
<!--<script src="/js/update.js"></script>-->
<script>
    const Name = document.getElementById("a_name");
    const Into1 = document.getElementById("info1");
    const Url = document.getElementById("a_url");
    Name.onblur =function () {
        const name = this;
        const reg = /^[\u2E80-\u9FFF]+$/;
        console.log(reg.test(name))
        if(!reg.test(name)){
            Into1.innerHTML='只能是汉字！不能为空';
            Into1.className='bg-danger';
            return;
        }
    }
    Url.onchange = function(event) {
        console.log(event)
    }
    $.ajax({
        'url':,
        'data':{"a_name":$('#a_value').val()},
            success: function(data) {
                alert(data.a_name);
                alert(data.a_url);

        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            alert(XMLHttpRequest.status);
            alert(XMLHttpRequest.readyState);
            alert(textStatus);
        },
        'type':'post',
        'dataType':'json',
    });
</script>

</body>
</html>